<!--
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
             label-width="68px">
      &lt;!&ndash;<el-form-item label="开票金额" prop="invoiceMoney">
        <el-input v-model="queryParams.invoiceMoney" placeholder="请输入开票金额"
                  clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="开票日期" prop="invoiceDate">
        <el-date-picker clearable v-model="queryParams.invoiceDate"
                        type="date" value-format="yyyy-MM-dd" placeholder="请选择开票日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="项目id" prop="projectId">
        <el-input v-model="queryParams.projectId" placeholder="请输入项目id"
                  clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>&ndash;&gt;
      &lt;!&ndash;<el-form-item label="项目名称" prop="projectName">
        <el-input v-model="queryParams.projectName" placeholder="请输入项目名称"
                  clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>&ndash;&gt;
    </el-form>

    <el-row :gutter="10" class="mb8">
     &lt;!&ndash; <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
                   v-hasPermi="['develop:ProjectInvoiceInfo:add']">新增
        </el-button>
      </el-col>&ndash;&gt;
      &lt;!&ndash;<el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
                   @click="handleUpdate" v-hasPermi="['develop:ProjectInvoiceInfo:edit']">修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-popconfirm title="确认删除选择的数据项？" @confirm="handleDelete({})">
          <el-button slot="reference" type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
                     v-hasPermi="['develop:ProjectInvoiceInfo:remove']">删除
          </el-button>
        </el-popconfirm>
      </el-col>&ndash;&gt;
      &lt;!&ndash;<el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini"
                   @click="handleExport" v-hasPermi="['develop:ProjectInvoiceInfo:export']">导出
        </el-button>
      </el-col>&ndash;&gt;
&lt;!&ndash;      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>&ndash;&gt;
    </el-row>

    <el-table border v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
&lt;!&ndash;      <el-table-column type="selection" width="55" align="center"/>&ndash;&gt;
&lt;!&ndash;      <el-table-column label="主键" align="center" prop="id"/>&ndash;&gt;
&lt;!&ndash;      <el-table-column label="备注" align="center" prop="remark"/>&ndash;&gt;
      <el-table-column label="发票编号" align="center" prop="taxNo"/>
      <el-table-column label="开票金额" align="center" prop="invoiceMoney"/>
      <el-table-column label="已核销金额" align="center" prop="backMoney"/>
      <el-table-column label="未核销金额" align="center" prop="remainMoney"/>
      <el-table-column label="开票日期" align="center" prop="invoiceDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.invoiceDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="发票核销状态" align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.fund_callback" :value="scope.row.status"/>
        </template>
      </el-table-column>
      <el-table-column label="备注信息" align="center" prop="infomation" show-overflow-tooltip/>
&lt;!&ndash;      <el-table-column label="项目id" align="center" prop="projectId"/>&ndash;&gt;
      <el-table-column label="项目名称" align="center" prop="projectName"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          &lt;!&ndash;<el-button size="mini" type="text" icon="el-icon-edit"
                     @click="handleUpdate(scope.row)" v-hasPermi="['develop:ProjectInvoiceInfo:edit']">修改
          </el-button>&ndash;&gt;
          <el-popconfirm :title="`确认删除该数据项？`" @confirm="handleDelete(scope.row)"
                         style="margin-left: 10px;">
            <el-button slot="reference" size="mini" type="text" icon="el-icon-delete" v-if="scope.row.status == '0'">删除
            </el-button>
          </el-popconfirm>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize" @pagination="getList"/>

    <projectInvoiceInfo-form ref="form" @ok="getList"></projectInvoiceInfo-form>
  </div>
</template>

<script>
    import {deleteAction, getAction} from '@/api/manage'
    import ProjectInvoiceInfoForm from '@/views/develop/projectInvoiceInfo/module/ProjectInvoiceInfoForm'

    export default {
        name: "ProjectInvoiceInfoListForPrjForm",
        dicts: ['fund_callback'],
        components: {
            ProjectInvoiceInfoForm,
        },
        props:{
            projectId: {
                type: String,
                required: true,
                default: ''
            }
        },
        data() {
            return {
                // 遮罩层
                loading: true,
                // 选中数组
                ids: [],
                // 非单个禁用
                single: true,
                // 非多个禁用
                multiple: true,
                // 显示搜索条件
                showSearch: true,
                // 总条数
                total: 0,
                // 项目开票信息管理表格数据
                dataList: [],
                // 查询参数
                queryParams: {
                    pageNum: 1,
                    pageSize: 20,
                    invoiceMoney: null,
                    invoiceDate: null,
                    infomation: null,
                    projectId: null,
                    projectName: null
                },
                url: {
                    list: '/projectInvoiceInfo/projectInvoiceInfo/list',
                    remove: '/projectInvoiceInfo/projectInvoiceInfo/',
                    export: '/projectInvoiceInfo/projectInvoiceInfo/export',
                },
            };
        },
        watch: {
            'projectId': {
                handler(newVal, oldVal) {
                    // console.log("33333333", newVal, oldVal)
                    this.queryParams.projectId = newVal;
                    this.getList();
                },
                deep: true,
                immediate: true
            }
        },
        /*
        computed:{

        },
        mounted(){
            this.getList();
        },*/
        created() {
            // this.queryParams.projectId = this.projectId;
            // this.getList();
        },
        methods: {
            getData(data) {
                let that = this;
                that.queryParams.projectId = data.id;
                that.getList();
            },
            /** 新增按钮操作 */
            handleAdd() {
                let data = {"projectId" : this.projectId, "projectName" : this.projectName};
                this.$refs.form.handleAddNew(data);
            },
            /** 查询项目开票信息管理列表 */
            getList() {
                this.loading = true;
                getAction(this.url.list, this.queryParams).then(response => {
                    this.dataList = response.rows;
                    this.total = response.total;
                    this.loading = false;
                });
            },
            /** 搜索按钮操作 */
            handleQuery() {
                this.queryParams.pageNum = 1;
                this.getList();
            },
            /** 重置按钮操作 */
            resetQuery() {
                this.resetForm("queryForm");
                this.handleQuery();
            },
            // 多选框选中数据
            handleSelectionChange(selection) {
                this.ids = selection.map(item => item.id)
                this.single = selection.length !== 1
                this.multiple = !selection.length
            },
            /** 修改按钮操作 */
            handleUpdate(row) {
                this.$refs.form.handleUpdate(row);
            },
            /** 删除按钮操作 */
            handleDelete(row) {
                const ids = row.id || this.ids;
                deleteAction(this.url.remove, ids).then(response => {
                    this.getList();
                    this.$modal.msgSuccess("删除成功");
                }).catch(() => {
                });
            },
            /** 导出按钮操作 */
            handleExport() {
                this.download(this.url.export, {
                    ...this.queryParams
                }, `projectInvoiceInfo_${new Date().getTime()}.xlsx`)
            },
        }
    };
</script>
-->
